/*
 * @Author: funlee
 * @Email: i@funlee.cn
 * @Date: 2019-07-03 14:28:59
 * @Description: 后续可用 RouteMenu 组件改写 render
 */
import React from "react";
import { Route, Redirect, HashRouter } from "react-router-dom";
import { AsyncPage } from "./utils/util";

import App from "@/containers/App/index";
const Home = AsyncPage(() => import("@/containers/Home"));
const ExcavateQuery = AsyncPage(() => import("@/containers/ExcavateQuery"));
const Analysis = AsyncPage(() => import("@/containers/Analysis"));
const Login = AsyncPage(() => import("@/containers/Login"));
const User = AsyncPage(() => import("@/containers/User"));
const AppInfoRetrievalDetails = AsyncPage(() => import("@/containers/AppInfoRetrievalDetails"));

// const MonitorWarningApp = AsyncPage(() => import("@/containers/Monitorwarning/app"));
// const MonitorWarningPeople = AsyncPage(() => import("@/containers/Monitorwarning/people"));
// const MonitorWarningSubject = AsyncPage(() => import("@/containers/Monitorwarning/subject"));
const MonitorWarning = AsyncPage(() => import("@/containers/Monitorwarning"));

const Router = () => (
    <HashRouter>
        <Route exact path="/" render={() => <Redirect to="/main/home" />} />
        <Route path="/main/login" component={Login} />
        <App>
            <Route path="/main/user" component={User} />
            <Route path="/main/home" component={Home} />
            <Route path="/main/appInfoRetrievalDetails" component={AppInfoRetrievalDetails} />
            <Route path="/main/excavateQuery" component={ExcavateQuery} />
            <Route path="/main/analysis" component={Analysis} />
            {/* <Route path="/main/monitor/app" component={MonitorWarningApp} />
            <Route path="/main/monitor/people" component={MonitorWarningPeople} />
            <Route path="/main/monitor/subject" component={MonitorWarningSubject} /> */}
            <Route path="/main/monitor" component={MonitorWarning} />
        </App>
    </HashRouter>
);

export default Router;
